<?php

/**
 * Usuario form base class.
 *
 * @package    form
 * @subpackage usuario
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseUsuarioForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_usuario'         => new sfWidgetFormInputHidden(),
      'nome'               => new sfWidgetFormInput(),
      'prontuario'         => new sfWidgetFormInput(),
      'cod_cadastro_unico' => new sfWidgetFormInput(),
      'cod_nis'            => new sfWidgetFormInput(),
      'id_usuario_pai'     => new sfWidgetFormDoctrineChoice(array('model' => 'Usuario', 'add_empty' => true)),
      'cpf'                => new sfWidgetFormInput(),
      'rg'                 => new sfWidgetFormInput(),
      'data_nascimento'    => new sfWidgetFormDate(),
      'endereco'           => new sfWidgetFormInput(),
      'situacao'           => new sfWidgetFormInput(),
      'observacao'         => new sfWidgetFormTextarea(),
      'telefone_fixo'      => new sfWidgetFormInput(),
      'telefone_celular'   => new sfWidgetFormInput(),
      'telefone_comercial' => new sfWidgetFormInput(),
      'regiao'             => new sfWidgetFormInput(),
      'data_abertura'      => new sfWidgetFormDate(),
      'data_cadastro'      => new sfWidgetFormDate(),
      'sexo'               => new sfWidgetFormInput(),
      'parentesco'         => new sfWidgetFormDoctrineChoice(array('model' => 'Apoio', 'add_empty' => true)),
      'grau_instrucao'     => new sfWidgetFormDoctrineChoice(array('model' => 'Apoio', 'add_empty' => true)),
      'ocupacao'           => new sfWidgetFormInput(),
      'renda_mensal'       => new sfWidgetFormInput(),
      'pai'                => new sfWidgetFormInput(),
      'mae'                => new sfWidgetFormInput(),
      'estado_civil'       => new sfWidgetFormDoctrineChoice(array('model' => 'Apoio', 'add_empty' => true)),
      'naturalidade'       => new sfWidgetFormInput(),
      'uf'                 => new sfWidgetFormDoctrineChoice(array('model' => 'Uf', 'add_empty' => true)),
      'procedencia_cidade' => new sfWidgetFormInput(),
      'ano_chegada'        => new sfWidgetFormInput(),
      'status'             => new sfWidgetFormInput(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_usuario'         => new sfValidatorDoctrineChoice(array('model' => 'Usuario', 'column' => 'id_usuario', 'required' => false)),
      'nome'               => new sfValidatorString(array('max_length' => 255)),
      'prontuario'         => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'cod_cadastro_unico' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'cod_nis'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'id_usuario_pai'     => new sfValidatorDoctrineChoice(array('model' => 'Usuario', 'required' => false)),
      'cpf'                => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'rg'                 => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'data_nascimento'    => new sfValidatorDate(array('required' => false)),
      'endereco'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'situacao'           => new sfValidatorString(array('max_length' => 4, 'required' => false)),
      'observacao'         => new sfValidatorString(array('required' => false)),
      'telefone_fixo'      => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'telefone_celular'   => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'telefone_comercial' => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'regiao'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'data_abertura'      => new sfValidatorDate(array('required' => false)),
      'data_cadastro'      => new sfValidatorDate(array('required' => false)),
      'sexo'               => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'parentesco'         => new sfValidatorDoctrineChoice(array('model' => 'Apoio', 'required' => false)),
      'grau_instrucao'     => new sfValidatorDoctrineChoice(array('model' => 'Apoio', 'required' => false)),
      'ocupacao'           => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'renda_mensal'       => new sfValidatorNumber(array('required' => false)),
      'pai'                => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'mae'                => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'estado_civil'       => new sfValidatorDoctrineChoice(array('model' => 'Apoio', 'required' => false)),
      'naturalidade'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'uf'                 => new sfValidatorDoctrineChoice(array('model' => 'Uf', 'required' => false)),
      'procedencia_cidade' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'ano_chegada'        => new sfValidatorInteger(array('required' => false)),
      'status'             => new sfValidatorInteger(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(array('required' => false)),
      'updated_at'         => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('usuario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Usuario';
  }

}
